<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateSystemNotifyCenterLogs extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('system_notify_center_logs', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('notifyCenterId')->index('idx_targetId')->default(0)->comment('消息 ID');
            $table->string('title')->default(0)->comment('日志标题');
            $table->string('content')->default(0)->comment('日志内容');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->string('createdBy')->default(0)->comment('创建人名字');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->string('updatedBy')->default(0)->comment('修改人名字');
            $table->unsignedTinyInteger('isDeleted')->default(0)->comment('是否删除');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '消息中心日志表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('system_notify_center_logs');
    }
}
